from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.get('http://www.baidu.com')
# 定位输入框
search_element = driver.find_element_by_id('kw')
# 输入内容
search_element.send_keys('不良人')
time.sleep(3)
# 删除输入框的内容,删除几个字 就乘几
search_element.send_keys(3 * Keys.BACK_SPACE)
